//package org.mobai.flow.camundaListener;
//
//import lombok.AllArgsConstructor;
//import org.camunda.bpm.engine.HistoryService;
//import org.camunda.bpm.engine.RepositoryService;
//import org.camunda.bpm.engine.TaskService;
//import org.camunda.bpm.spring.boot.starter.event.TaskEvent;
//import org.springframework.context.event.EventListener;
//import org.springframework.stereotype.Component;
//
///**
// * @author Administrator
// */
//@Component
//@AllArgsConstructor
//public class TaskListener {
//    private final RepositoryService repositoryService;
//    private final HistoryService historyService;
//    private final TaskService taskService;
//
//    @EventListener
//    public void onTaskEvent(TaskEvent taskEvent) {
////        BpmnModelInstance bpmnModelInstance = repositoryService.getBpmnModelInstance(taskEvent.getProcessDefinitionId());
////        ModelElementInstance modelElementById = bpmnModelInstance.getModelElementById(taskEvent.getTaskDefinitionKey());
////
////        Collection<CamundaProperty> camundaProperties = ((BaseElement) modelElementById).getExtensionElements().getElementsQuery().filterByType(CamundaProperties.class).singleResult().getCamundaProperties();
////        for (CamundaProperty camundaProperty : camundaProperties) {
////            String name = camundaProperty.getCamundaName();
////            String value = camundaProperty.getCamundaValue();
////            System.out.println(name + ":" + JSONUtil.toBean(value, Map.class));
////        }
//
//
//        System.out.println("taskId:" + taskEvent.getId());
//    }
//}
